
from sqlalchemy import *
from sqlalchemy import Column, ForeignKey
from sqlalchemy.orm import relation, backref
from sqlalchemy.types import Integer, Text

from suportepaispython.model import DeclarativeBase

class UnidadeFederativa(DeclarativeBase):
	__tablename__ = 'UnidadeFederativa'

	id=Column(Integer, primary_key=True)
									
	codigo = Column(Text,unique=True)
									    
	descricao = Column(Text)
		

	pais_id = Column(Integer, ForeignKey('Pais.id'))

	pais = relation("Pais",backref=backref("UnidadeFederativa", order_by=id))


	def __init__(self, codigo, descricao):
		self.codigo = codigo
		self.descricao = descricao
